package jp.sourceforge.akjrcp.ui;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;

public class LabelTextLabel extends Composite{
public LabelTextLabel(Composite parent, int style,String headerText,String text,String footerText) {
this(parent,style,headerText,text,footerText,true);
}
	public LabelTextLabel(Composite parent, int style,String headerText,String text,String footerText,boolean isReadOnly) {
		super(parent, style);
		int readOnly=SWT.None;
		if(isReadOnly){
			readOnly=SWT.READ_ONLY;
		}
		this.setLayout(new GridLayout(3,false));
		headerLabel=new Label(this,SWT.NULL);
		headerLabel.setText(headerText);
		mainText=new Text(this,readOnly|SWT.BORDER);
		mainText.setText(text);
		footerLabel=new Label(this,SWT.NULL);
		footerLabel.setText(footerText);
	}
public void setLayoutData(GridData header,GridData text,GridData footer){
	headerLabel.setLayoutData(header);
	mainText.setLayoutData(text);
	footerLabel.setLayoutData(footer);
}
public String getText(){
	return mainText.getText();
}
public void setText(String text){
	 mainText.setText(text);
}
private Label headerLabel;
private Text mainText;
private Label footerLabel;
public Label getFooterLabel() {
	return footerLabel;
}
public void setFooterLabel(Label footerLabel) {
	this.footerLabel = footerLabel;
}
public Label getHeaderLabel() {
	return headerLabel;
}
public void setHeaderLabel(Label headerLabel) {
	this.headerLabel = headerLabel;
}
public Text getMainText() {
	return mainText;
}
public void setMainText(Text mainText) {
	this.mainText = mainText;
}

}
